package 综合应用.T1;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class T1 {

    public static void main(String[] args) throws IOException {


        List<String> list = FileUtils.readLines(new File("综合应用/T1/data.txt"));
        ArrayList<String> list1 = new ArrayList<>();
        for (int i = list.size()-1; i >= 0; i--) {
            list1.add(list.get(i).split("=")[1]);
        }
        System.out.println(list1);

        byte[] bytes = new byte[list1.size()];
        for (int i = 0; i < list1.size(); i++) {
            bytes[i]=(byte)((byte)Integer.parseInt(list1.get(i))+2);
        }
        System.out.println(Arrays.toString(bytes));
        FileUtils.writeByteArrayToFile(new File("综合应用/T1/a.jpg"),bytes);
    }
}
